<style>
.rt_content{background-color: #FFF;padding: 20px;}
</style>
<div class="page_title">
    <h2 class="fl">{$pageTitle}</h2>
</div>
<section>
    <ul class="ulColumn2">
        <input type="hidden" name="config_id" value="{:encrypt_id($info.config_id)}" />
        <li>
            <span class="item_name" style="width:120px;">视频默认标题：</span>
            <input name="video_title" type="text" class="textbox textbox_295" value="{$info.value.video_title}" maxlength="14" placeholder="" />
            <div class="tishi"><i class="iconfont iconfont-tishi"></i>[uname]字符会替换为用户昵称,其他字符最长为7位</div>
        </li>
        <li>
            <span class="item_name" style="width:120px;">视频有效时间：</span>
            <input name="video_effective_time" type="text" class="textbox textbox_295" value="{$info.value.video_effective_time}" placeholder="建议视频保存时间超过30s" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')"/>
            <div class="tishi"><i class="iconfont iconfont-tishi"></i>超过指定时间才会生成视频(单位:秒)</div>
        </li>
        
        <li>
            <span class="item_name" style="width:120px;">开启回放功能：</span>
            <input type="checkbox" id="checkbox_d1" class="chk_4" {eq name="info.status" value="1"}checked{/eq} />
            <label for="checkbox_d1">
                <input type="hidden" name="status" value="{$info.status}"/>
            </label>
            <div class="tishi"><i class="iconfont iconfont-tishi"></i>关闭回放功能将不会生成视频</div>
        </li>
        <li>
            <span class="item_name" style="width:120px;"></span>
            <input type="submit" id="submit" class="link_btn" value="保存"/>
        </li>
    </ul>
</section>
<script>
$(function(){
    $("#submit").click(function(){
        var send_data = {
              url:U('admin/Stream/video_config'),
              type:'POST',
              data:{
                  config_id:'{:encrypt_id($info.config_id)}',
                  status:$('input[name="status"]').val() == '1' ? 1 : 0,
                  video_title:$("input[name='video_title']").val(),
                  time:$("input[name='video_effective_time']").val()
              }
        };
        send_ajax(send_data,function(res){
            if(res.status == 1){
                msg_success(res.data.info,'',1000);
                setTimeout(function(){
                    admin.getContentByUrl(res.data.jumpurl);
                },1000);
            }else{
                msg_error(res.message);
            }
        })
    })
});
</script>